<?php
if(!isset($MAIN)){
	include_once("includes/class.ibnfm.php");
	$MAIN = new MAIN();
}
$cat = $page = "start.php";
if(isset($_REQUEST['cat'])){
	$cat = $page = $_REQUEST['cat'].".php";
	if(isset($_REQUEST['id'])){
		$cat.='&id='.$_REQUEST['id'];
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>IBN Rushd | Facility Mangement</title>
<meta name="Keywords" content=""/>
<meta name="Description" content=""/>
<link href="http://fonts.googleapis.com/css?family=Quicksand:300,400,700" rel="stylesheet" type="text/css"/>
<link href="src/styles.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="src/moo.js"></script>
<script type="text/javascript" src="src/scripts.js"></script>
<script src="src/Picker.js" type="text/javascript"></script>
<script src="src/Picker.Attach.js" type="text/javascript"></script>
<script src="src/Picker.Date.js" type="text/javascript"></script>
<link href="src/datepicker_dashboard/datepicker_dashboard.css" rel="stylesheet"/>
</head>
<body>
	<div id="header">
		<table cellpadding="0" cellspacing="0" style="width:100%;">
		<tr>
			<td style="width:15%;"><a id="logo" href="index.php"></a></td>
			<td style="width:60%;text-align:center;"><h1 class="page_title">Facility Management</h1></td>
			<td style="width:25%;"><?php include("login.php");?></td>
		</tr>
		</table>
		<div id="menu">			
			<ul>
				<?php if($MAIN->users->checkLogin(false)){?>
				<?php if($MAIN->currentUser['grouplevel']<=70){ ?>
				<li><a href="?cat=profile" class="btn <?php if($page=='profile.php'){?>active<?php }?>">Din Profil</a></li>
				<?php } ?>
				<?php if($MAIN->currentUser['grouplevel']<50){ ?>
				<li><a href="?cat=users" class="btn <?php if($page=='users.php'){?>active<?php }?>">Anvädare/Medlemar</a></li>
				<?php } ?>
				<?php if($MAIN->currentUser['grouplevel']>=50){ ?>
				<li><a href="?cat=persons" class="btn <?php if($page=='persons.php'){?>active<?php }?>">Mina medlemar</a></li>
				<?php } ?>
				<?php if($MAIN->currentUser['grouplevel']<50){ ?>
				<li><a href="?cat=associations" class="btn <?php if($page=='associations.php'){?>active<?php }?>">Föreningar</a></li>
				<?php } ?>
				<?php if($MAIN->currentUser['grouplevel']==50){ ?>
				<li><a href="?cat=associations" class="btn <?php if($page=='associations.php'){?>active<?php }?>">Mina föreningar</a></li>
				<?php } ?>
				<?php if($MAIN->currentUser['grouplevel']>50){ ?>
				<li><a href="?cat=circles" class="btn <?php if($page=='circles.php'){?>active<?php }?>">Mina aktiviteter</a></li>
				<?php } ?>
				<?php if($MAIN->currentUser['grouplevel']<=50){ ?>
				<li><a href="?cat=circles" class="btn <?php if($page=='circles.php'){?>active<?php }?>">Aktiviteter</a></li>
				<?php } ?>
				<li><a href="?cat=registrations" class="btn <?php if($page=='registrations.php'){?>active<?php }?>">Föranmälningar</a></li>
				<?php } ?>
			</ul>			
		</div>
	</div>
	<div id="menu_area">
		<div id="tongue"></div>		
	</div>
	<div id="container">
		<table cellpadding="0" cellspacing="0" style="width:100%;">
		<tr>
			<td style="width:75%; vertical-align:top;">
			<?php include($page);?>
			</td>
			<td id="sidebar_left" style="width:25%; vertical-align:top;">
			<?php include_once('nav.php');?>	
			</td>
		</tr>
		</table>
	</div>
</body>
</html>